package cc.comac.mom.datahandlers.third.lifelimit;

import cc.comac.mom.entity.QualityQarCheckInvoiceEntity;
import cc.comac.mom.util.ResultBean;
import com.alibaba.ans.shaded.com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import java.nio.charset.StandardCharsets;

public class EquipLiftLimitPartInstance {

    @Autowired
    private RestTemplate restTemplate;

    public ResultBean sendOutSourceData(QualityQarCheckInvoiceEntity qualityQarCheckInvoiceEntity){
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON);
        String jsonData=JSONObject.toJSONString(qualityQarCheckInvoiceEntity);
        HttpEntity<String> requestEntity = new HttpEntity<String>(jsonData, headers);
        //发送请求，设置请求返回数据格式为String
        ResponseEntity<ResultBean> responseEntity = restTemplate.postForEntity("http:xxx.xx", jsonData, ResultBean.class);
        return null;
    }
}
